package com.noble.meether.fragment.start.dialog;

import android.os.Bundle;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.noble.meether.R;
import com.noble.library.view.base.BaseDialogFragment;
import com.noble.meether.MeetUIShow;

/**
 * 充值/分享弹框
 */
public class PayShareDialog extends BaseDialogFragment implements View.OnClickListener {

    public PayShareDialog() {
        settWindowAnimations(R.style.AnimDownInDownOutOverShoot);
        setGravity(Gravity.CENTER);
        setDialogSizeRatio(0, 0);
        setCanceledOnTouchOutside(false);
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        super.onCreateView(inflater, container, savedInstanceState);
        setContentView(R.layout.dialog_pay_share);
        initView();
        return getContentView();
    }

    private void initView() {
        findViewById(R.id.btn_submit).setOnClickListener(this);
        findViewById(R.id.btn_pay).setOnClickListener(this);
        findViewById(R.id.btn_share).setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.btn_submit:
                dismiss();
                break;
            case R.id.btn_pay:
                MeetUIShow.showMyDiamondsAct(getActivity());
                dismiss();
                break;
            case R.id.btn_share:
                MeetUIShow.showInviteAct(getContext());
                dismiss();
                break;
        }
    }
}